import fetch from '@/utils/fetch';



// 说明：抄表机抄表分页查询(条件搜索)
// 接口：api/cb/flManualReading/search/{page}/{size}
// 请求类型：Post

export function searchFlManualReading(page, size, obj) {
    return fetch({
        url: 'api/cb/flManualReading/MeterReadingMachine/' + page + '/' + size,
        method: 'post',
        data: obj
    });
}

// 说明：录入读数
// 接口：api/cb/flManualReading/{id}
// 请求类型：post
export function inputReadNum(id, readNum) {
    return fetch({
        url: `api/cb/flManualReading/inputReadNum?id=${id}&readNum=${readNum}`,
        method: 'post'
    })
}

// 说明：获取单个抄表机抄表
// 接口：api/cb/flManualReading/{id}
// 请求类型：get
export function getFlManualReading(id) {
    return fetch({
        url: 'api/cb/flManualReading/' + id,
        method: 'get'
    })
}

// 导出db
export function getDbfData(obj) {
    return fetch({
        url: 'api/cb/flManualReading/getDbfData',
        // responseType: 'blob',
        method: 'post',
        data: obj
    });
}
// 导出捷先
export function getJXDbfData(obj) {
    return fetch({
        url: 'api/cb/flManualReading/getJXDbfData',
        // responseType: 'blob',
        method: 'post',
        data: obj
    });
}
// 导出三川
export function getSCData(obj) {
    return fetch({
        url: 'api/cb/flManualReading/getSCData',
        // responseType: 'blob',
        method: 'post',
        data: obj
    });
}
// 导入db
export function postDbfData(obj) {
    return fetch({
        url: `api/cb/flManualReading/postDbfData`,
        // url: `api/cb/flManualReading/postDbfData?param=${obj}`,
        method: 'post',
        data: obj
            // param:{
            //   "PZTdata":PZTdata,
            //   "batchId":batchId
            // }
            // headers:{"dbfData":PZTdata,"batchId":batchId}
    });
}
// 导入捷先
export function postJXDbfData(obj) {
    return fetch({
        url: 'api/cb/flManualReading/postJXDbfData',
        method: 'post',
        data: obj
            // headers:{"dbfData":PZTdata,"batchId":batchId}
    });
}
// 导入三川
export function postSCData(obj) {
    return fetch({
        url: 'api/cb/flManualReading/postSCData',
        method: 'post',
        data: obj
            // headers:{"dbfData":PZTdata,"batchId":batchId}
            // header:{
            //   Authorization:{"dbfData":PZTdata,"batchId":batchId}
            // }
            // Authorization:{"dbfData":PZTdata,"batchId":batchId}
            // data: obj
    });
}

// 说明：抄表机导出Excel数据 /flManualReading/exprotXlsM/{ids}
export function exprotXlsManual(ids, obj) {
    return fetch({
        url: `api/cb/flManualReading/exprotXlsM/${ids}`,
        responseType: "blob",
        method: "post",
        data: obj
    });
}